package com.lovo.cloud.controller;


import com.lovo.cloud.model.dto.Order2DTO;
import com.lovo.cloud.service.Order2Service;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author luo
 * @since 2020-12-09
 */
@CrossOrigin
@RestController
@RequestMapping
public class Order2Controller {

    @Resource
    private Order2Service order2Service;

    @PostMapping("/addOrder")
    public String addOrder(@RequestBody Order2DTO order2DTO){

        if ( order2Service.addOrder(order2DTO)) {
            return "下单成功";
        }else {
            return "下单失败";
        }
    }

}

